package ord.csmz.xg2333.Example04;

public class Example04 {
    public static void main(String[] args){
        String s1 = "java XinGuan2333";
        String s2 = "Java XinGuan2333";
        System.out.println("字符串"+s1+"是否是java开头:"+s1.startsWith("java"));
        System.out.println("字符串"+s1+"是否是2333结尾："+s1.endsWith("2333"));
        System.out.println("字符串"+s1+"是否是空字符："+s1.isEmpty());
        System.out.println("字符串"+s1+"是否包含字符XinGuan："+s1.contains("XinGuan"));
        System.out.println("字符串"+s1+","+s2+"内容是否相同："+s1.equals(s2));
        System.out.println("字符串"+s1+","+s2+"忽略大小写的情况下是否相同："+s1.equalsIgnoreCase(s2));
        System.out.println("字符串"+s2+","+s2+"按Unicode比较大小的结果为:"+s1.compareTo(s2));
    }
}
